package net.edisoft.model;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

@Entity
@Table(name="details")
public class Detail implements Serializable{

	/**
	 * 
	 */
	private static final long serialVersionUID = -3765045184798697411L;

	private Long id;

	@ManyToOne
    @JoinColumn(name="header_id", referencedColumnName = "id", nullable = false)
	private Header headerid;

	private Integer linenumber;
	private Integer supplieritemcode;
	private String itemdescription;
	private double invoicequantity;
	private double invoiceunitnetprice;

	public Detail() {
	}
	
	public Detail(Integer linenumber) {
		this.linenumber = linenumber;
	}

	public Detail(Integer linenumber, Integer supplieritemcode, String itemdescription,
			double invoicequantity, double invoiceunitnetprice) {
		this.linenumber = linenumber;
		this.supplieritemcode = supplieritemcode;
		this.itemdescription = itemdescription;
		this.invoicequantity = invoicequantity;
		this.invoiceunitnetprice = invoiceunitnetprice;
	}
	@Id
	@GeneratedValue
	@Column(name="id")
	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	public Header getHeaderid() {
		return headerid;
	}
	public void setHeaderid(Header headerid) {
		this.headerid = headerid;
	}
	
	@Column(name="linenumber")
	public Integer getLinenumber() {
		return linenumber;
	}
	public void setLinenumber(Integer linenumber) {
		this.linenumber = linenumber;
	}
	@Column(name="supplieritemcode")
	public Integer getSupplieritemcode() {
		return supplieritemcode;
	}
	public void setSupplieritemcode(Integer supplieritemcode) {
		this.supplieritemcode = supplieritemcode;
	}
	@Column(name="itemdescription")
	public String getItemdescription() {
		return itemdescription;
	}
	public void setItemdescription(String itemdescription) {
		this.itemdescription = itemdescription;
	}
	@Column(name="invoicequantity")
	public double getInvoicequantity() {
		return invoicequantity;
	}
	public void setInvoicequantity(double invoicequantity) {
		this.invoicequantity = invoicequantity;
	}
	@Column(name="invoiceunitnetprice")
	public double getInvoiceunitnetprice() {
		return invoiceunitnetprice;
	}
	public void setInvoiceunitnetprice(double invoiceunitnetprice) {
		this.invoiceunitnetprice = invoiceunitnetprice;
	}

}
